userLong
SPB structure
#include <Sound.h>
typedef struct SPB { Size Offset Description
long inRefNum; 4 0 reference number of input device
unsigned long count; 4 4 number of bytes to record
unsigned long milli seconds; 4 8 number of milli seconds to record
unsigned long bufferLength; 4 12 length of buffer to record into
Ptr buffer 4 16 pointer to buffer to record into
ProcPtr completionRoutine; 4 20 pointer to a completion routine
ProcPtr interruptRoutine; 4 24 pointer to an interrupt routine
long userLong; 4 28 for application's use
OSErr error 2 32 error returned after recording
long unused1 4 34 reserved
} SPB; 38
typedef SPB *SPBPtr;
Field descriptions
inRefNum The reference number of the sound input device (as
received from SPBOpenDevice) from which the
recording is to occur.
count On input, the number of bytes to record. On output, the
number of bytes actually recorded. If this field
specifies a longer recording time than the milli seconds
field, then the milli seconds field is ignored on input.
milli seconds On input, the number of milli seconds to record. On
output, the number of milli seconds actually recorded. If
this field specifies a longer recording time than the
count field, then the count field is ignored on input.
bufferLength The length of the buffer into which recorded sound data
is placed. The recording time specified by the count or
milli seconds field is truncated to fit into this length, if
necessary.
bufferPtr A pointer to the buffer into which recorded data is
placed. If this field is NULL, then the count,
milli seconds, and bufferLength fields are ignored and the
recording will continue indefinitely until
SPBStopRecording is called. However, the data is
not stored anywhere, so setting this field to NULL is
useful only if you want to do something in your
interrupt routine but do not want to save the recorded
sound.
completionRoutine A pointer to a completion routine that is called when
the recording terminates as a result of your calling
SPBStopRecording or when the limit specified by
the count or milli seconds field is reached. The
completion routine executes only if SPBRecord is
called asynchronously and therefore is called at
interrupt time.
interruptRoutine A pointer to a routine that is called by asynchronous
recording devices when their internal buffers are full.
userLong A long integer available for the application's own use.
You can use this field, for instance, to pass a handle to
an application- defined structure to the completion
routine or to the interrupt routine.
error A code describing any errors that occur during the
recording. If the recording terminates without an
error, this field contains noErr. If any error occurs
during the recording, this field contains a value of type
OSErr. If the recording is terminated by a call to
SPBStopRecording , this field contains the value
abortErr . You can poll this field while recording
asynchronously to determine if any errors have
occurred.
unused1 Reserved for use by Apple. You should always
initialize this field to 0.